package com.demo.springBoot2.entity.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @Author pl711@qq.com
 * @PackageName springBoot2
 * @Package com.demo.springBoot2.entity.vo
 * @Date 2024/3/16 22:44
 * @Version 1.0
 * 利用手机号注册账户VO
 */
@Data
@ApiModel(value = "user对象",description = "用于添加用户")
public class UsersInfoPhoneVO {

    @NotNull(message = "手机号不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号必须是11位中国手机号")
    @ApiModelProperty(value = "手机号",required = true)
    private String phone;

    @NotNull(message = "密码不能为空")
    @Length(min = 6,max = 11,message = "密码必须在6-11位")
    @Pattern(regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d).+$", message = "密码必须包含大小写字母和数字")
    @ApiModelProperty(value = "密码",required = true)
    private String password;

    @NotNull(message = "昵称不能为空")
    @Length(min = 1,max = 13,message = "昵称必须在1-13位")
    @ApiModelProperty(value = "昵称",required = true)
    private String nickname;
}
